package com.lp.mgt.entities;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import org.apache.ibatis.type.Alias;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.multipart.MultipartFile;

import com.lp.mgt.commons.Pager.Page;

import lombok.Data;
@Alias("user")
@Data
public class User extends Page implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2936207780011135740L;
private String uid;
private String username;
private String password;
private String realname;
private String sex;
private Integer age;
private String phone;
private String salt;
private String state;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
private Date createTime;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
private Date expireDate;
private String email;
private String delFlag;
private String aid;//关联头像id单个
private String did;//部门id单个
private String createBy;//创建人


private Boolean rememberMe;
private String picCode;

private MultipartFile headPicture;//头像

private List<Role> roles;// 一个用户具有多个角色

private Avatar avatar;//头像信息



private String postId;//可能为多个新增时用
private String roleIds;//可能为多个新增时用

private List<String> deptIds;//查询条件字段 部门id:用户查询

/**
 * 密码盐. 重新对盐重新进行了定义，用户名+salt，这样就不容易被破解，可以采用多种方式定义加盐
 * @return
 */
public String getCredentialsSalt(){
    return this.username+"shiro";
}

public String isFocus;//是否关注
}
